"Syntax Lexer" dialog


This dialog is intended for customizing lexer. It includes:
· Lexer common properties...
· Text styles.
· Token rules
· Block rules
· Sub lexer rules
· Code templates.
· Sample text.

To show this dialog you must click "Customize Lexer" button in main menu (lamp button)

Button commands.

Export Opens save dialog to save lexer configuration to the file (*.LCF).
Import Opens open dialog to load lexer configuration from file (*.LCF).
Apply Applies changes.
OK Save changes.
Cancel Cancel changes.

Preview text

At the bottom of the "Syntax Lexer" dialog editor with the sample code is placed. Any change of lexer configuration effects on the sample code. This preview text also is used in the "Syntax Highlighting" dialog that is intended to change only styles.

Common page

Lexer name - name of the lexer. Usually it is a name of file format (language).
File extensions - for autodetect lexer by file extensions
Token type names are associated with the integer value (line number). They are used to simplify token type assignment to the token rules and selecting a set of token types for conditions of block rules. Token type is integer value in th range [0..31]. 
Default Style - default style which first is applied to the editor canvas. For default style you may specify font and background color. If default style is not specified, editor Font and Color properties are used. 
Selection mark style is a style for selected block in the syntax memo. If no style is selected to draw selection in the editor default foreground and background are used (clHighlightText and clHighlight).
Search mark style is a style to mark out search results in the syntax memo. If no style is selected to draw search results in the editor default foreground and background are used (clWhite and clBlack).
Current Line Style - style that is used to draw current line (line with the caret). If you don't want highlight current line select style type "Only Background" and color of background "None".
Default Style - default style which first is applied to the editor canvas. For default style you may specify font and background color.
Skip spaces while parsingcheck box specifies how to process space characters (space, HT/TAB, CR, NL, FF). If it is checked all space characters will be skipped before token rules checking, otherwise they will not be skipped. 
Do not skip end of line - specifies whether line breaks should be parsed. 
Restart analysis from line start - if it is ON parser results are cleared starting from start of line where text was changed, otherwise they are cleared after position of text changing. 
Always synchronized block analysis - specifies whether block analysis should be always performed with text parsing, otherwise analyzer tries to perform block analysis after whole text was parsed. 
Disable full refresh if text size is greater - specifies threshold after which full refresh (when text is changed) of sytactical obects will not be performed. If this value is 0 (by default), full refreshing is disabled. Full refreshing takes more time, but sometimes it may be useful for some parser's rules(for example, parser expression " ".*" " will not work correctly without full refresh).

Code templates page

At this page you can create, delete or change code templates .
If check box at the left side of the template in the list view is checked, template supports advanced syntax like in CodeRush, otherwise it supports simple syntax like in Borland's IDE.
In avanced templates you may use: <caret> - specifies caret position (must be single), <paste> - inserts clipboard text, <marker> - drops stack-based marker.
In simple templates you may specify only caret position using "|" character.
Available code templates are listed by name with a short description. While working in the Syntax Memo, press Ctrl+J to display the code templates defined. Click a template name to display the code that will be entered in your file when that template is selected. Code displayed in the code window can be edited. Double-click on a template to insert it into your code.

Rules and style are described in the next topics:
Common for styles and rules.
Styles ("Styles" page).
Token rules ("Parser" page).
Block rules ("Rules" page).
Nested lexers ("Sub lexers" page).


// econtrol.ru // sepa.spb.ru //